# -*- coding: utf-8 -*-
#
# Copyright © 2011 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)

"""Transitional package (PyQt4 --> PySide)"""

import os, imp

for _default_modname in ('PyQt4', 'PySide'):
    try:
        imp.find_module(_default_modname)
        break
    except ImportError:
        pass

_modname = os.environ.setdefault('PYTHON_QT_LIBRARY', _default_modname)
assert _modname in ('PyQt4', 'PySide')

if _modname == 'PyQt4':
    import sip
    sip.setapi('QString', 2)
    sip.setapi('QVariant', 2)
    from PyQt4.QtCore import PYQT_VERSION_STR as __version__
    __version_info__ = tuple(__version__.split('.')+['final', 1])
    is_pyqt46 = __version__.startswith('4.6')
else:
    import PySide
    __version__ = PySide.__version__
    from PySide import *
    is_pyqt46 = False
